package com.hh.tc.ui.clockIn.monthList

import androidx.databinding.ObservableArrayList
import androidx.lifecycle.SavedStateHandle
import com.hh.base.log.Logger
import com.hh.base.ui.BaseViewModel
import com.hh.base.util.ext.toJsonString
import com.hh.db.core.ObjectBoxUtil
import com.hh.db.entity.ClockMonth
import com.hh.tc.ui.clockIn.monthDetails.MonthDetailActivity

/**
 * Create By hHui on 2025/4/7 14:25
 *
 * @description
 */
class MothListViewModel(handle: SavedStateHandle) : BaseViewModel(handle) {
    val monthList = ObservableArrayList<ClockMonth>()

    override fun initData() {
        monthList.addAll(ObjectBoxUtil.clockMonthBox.all)
    }

    fun onItemClick(data: Any) {
        if (data is ClockMonth) {
            val map = HashMap<String, String>()
            map["month"] = data.month
            jump2Activity(MonthDetailActivity::class.java, false, map)
        }
    }
}